
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetReportingPeriods]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[GetReportingPeriods]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/******************************************************************  
* Name:   GetReportingPeriods
* Purpose:  Retrieves the COI with the specified Id  
*  
* PARAMETERS  
* Name         Description       
* -------------      -------------------------------------------  
* @coiId     COI Id  
******************************************************************/  
  
CREATE Procedure [dbo].[GetReportingPeriods]  
(
	@COITypeId INT = 1
)
AS  
BEGIN  
  
 SET NOCOUNT ON  
  
 SELECT Id, ReportingPeriod, COITypeId  
 FROM COIReportingPeriods 
 WHERE 
 COITypeId = @COITypeId

END  

GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF  

  

  
  